package com.bianxingji.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisPlusConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        // 配置分页插件的一些参数（可选）
        // 当请求的页码大于最大页数时，是否进行返还空数据的操作，默认 false
        paginationInterceptor.setOverflow(false);
        // 设置最大单页限制数，默认 500
        paginationInterceptor.setLimit(1000);
        return paginationInterceptor;
    }
}
